From 5402421c95a7a26401b24662226b560806606d59 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Tue, 1 Mar 2011 17:54:15 +0000 Subject: [PATCH] Kill all other uses of $wgHooks in includeExtensions() other than LoadExtensionSchemaUpdates (which is the *only* one we want). People do stupid stuff in places like ParserFirstCallInit, and we don't want to risk them doing something like opening a DB connection or other things that are gonna fail --- includes/installer/Installer.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index b812ad72c3..ae8b68afed 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -1215,6 +1215,14 @@ abstract class Installer { require( "$path/$e/$e.php" ); } + $hooksWeWant = isset( $wgHooks['LoadExtensionSchemaUpdates'] ) ? + $wgHooks['LoadExtensionSchemaUpdates'] : array(); + + // Unset everyone else's hooks. Lord knows what someone might be doing + // in ParserFirstCallInit (see bug 27171) + unset( $wgHooks ); + $wgHooks = array( 'LoadExtensionSchemaUpdates' => $hooksWeWant ); + return Status::newGood(); } -- 2.20.1